﻿using HCore;
using MEat;
using UnityEngine;

public class DummyDisplay : DisplayObject
{
    private GameObject _gameObject;

    public DummyDisplay(BaseGameEntity entity) : base(entity)
    {
        GameObject dummyPrefab = Resources.Load<GameObject>("dummy");
        _gameObject = GameObject.Instantiate(dummyPrefab);
        _gameObject.name = "dummy-" + entity.ID;
    }

    public override void Dispose()
    {
        // GameObject.Destroy(_gameObject);
        // _gameObject = null;
    }

    public override void Update()
    {
        _gameObject.transform.position = _owner.position.ToUVec3();
        _gameObject.transform.forward = ((Dummy) _owner).forward.ToUVec3();
    }
}